#include<iostream>
using namespace std;
int main(){
    int n,m;
    while (cin>>n>>m&&n<=1000&&(m!=0&&n!=0))
    {
        int a[1000],t;
        for(int i=0;i<n;i++){
            cin>>a[i];
            if(a[i]<=m){
                t=i;
            }
        }
        for(int i=n;i>t;i--){
            a[i]=a[i-1];
        }
        a[t+1]=m;
        for(int i=0;i<=n;i++){
            cout<<a[i];
            if(i!=n){
                cout<<" ";
            }
        }
        cout<<endl;
    }
    
}